package com.arron.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class IteratorCode {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("~~Jack");
        list.add("~~Tom");
        list.add("~~Timothy");

        Iterator iterator =list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
